home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / chardet / nsIDocCharset.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  4KB  |  135 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIDocCharset.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIDocCharset_h__
  6. #define __gen_nsIDocCharset_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17.  
  18. /* starting interface:    nsIDocCharset */
  19. #define NS_IDOCCHARSET_IID_STR "9c18bb4e-1dd1-11b2-bf91-9cc82c275823"
  20.  
  21. #define NS_IDOCCHARSET_IID \
  22.   {0x9c18bb4e, 0x1dd1, 0x11b2, \
  23.     { 0xbf, 0x91, 0x9c, 0xc8, 0x2c, 0x27, 0x58, 0x23 }}
  24.  
  25. /**
  26.  * The nsIDocCharset interface allows the user to view, 
  27.  * hint, and set which converter is used to read the document's 
  28.  * data.
  29.  *
  30.  * <P>Inside Mozilla all text is encoded as Unicode. By standardizing  
  31.  * on Unicode every piece of code that handles characters no longer 
  32.  * needs to: 
  33.  *
  34.  *     Have access to a character encoding parameter.
  35.  *     Ask is the data stateful?
  36.  *     Ask is the data single byte?
  37.  *     Ask is the data multi-byte?
  38.  *     If multi-byte: have access to a routine that can
  39.  *         determine how many bytes in the current character.
  40.  *
  41.  * When the document is read in a converter is used to convert 
  42.  * the document's data to Unicode.
  43.  *
  44.  * nsIDocCharset provides the ability to:
  45.  *
  46.  *   See what converter was used when inputting the documents
  47.  *   data.
  48.  *
  49.  *   Override the character set for documents where the specified 
  50.  *   fallback, or auto-detected character set is incorrect
  51.  *
  52.  */
  53. class NS_NO_VTABLE nsIDocCharset : public nsISupports {
  54.  public: 
  55.  
  56.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_IDOCCHARSET_IID)
  57.  
  58.   /**
  59.      * Get/sets the encoding (converter) used to read the 
  60.      * document. Get returns the encoding used. Set forces 
  61.      * (overrides) the encoding. After forcing the charset the 
  62.      * embedding application will need to cause the data to be 
  63.      * reparsed in order to update the DOM / display.
  64.      *
  65.      * A force also sets the fallback encoding for this frame.
  66.      */
  67.   /* attribute string charset; */
  68.   NS_IMETHOD GetCharset(char * *aCharset) = 0;
  69.   NS_IMETHOD SetCharset(const char * aCharset) = 0;
  70.  
  71. };
  72.  
  73. /* Use this macro when declaring classes that implement this interface. */
  74. #define NS_DECL_NSIDOCCHARSET \
  75.   NS_IMETHOD GetCharset(char * *aCharset); \
  76.   NS_IMETHOD SetCharset(const char * aCharset); 
  77.  
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  79. #define NS_FORWARD_NSIDOCCHARSET(_to) \
  80.   NS_IMETHOD GetCharset(char * *aCharset) { return _to GetCharset(aCharset); } \
  81.   NS_IMETHOD SetCharset(const char * aCharset) { return _to SetCharset(aCharset); } 
  82.  
  83. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  84. #define NS_FORWARD_SAFE_NSIDOCCHARSET(_to) \
  85.   NS_IMETHOD GetCharset(char * *aCharset) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCharset(aCharset); } \
  86.   NS_IMETHOD SetCharset(const char * aCharset) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetCharset(aCharset); } 
  87.  
  88. #if 0
  89. /* Use the code below as a template for the implementation class for this interface. */
  90.  
  91. /* Header file */
  92. class nsDocCharset : public nsIDocCharset
  93. {
  94. public:
  95.   NS_DECL_ISUPPORTS
  96.   NS_DECL_NSIDOCCHARSET
  97.  
  98.   nsDocCharset();
  99.  
  100. private:
  101.   ~nsDocCharset();
  102.  
  103. protected:
  104.   /* additional members */
  105. };
  106.  
  107. /* Implementation file */
  108. NS_IMPL_ISUPPORTS1(nsDocCharset, nsIDocCharset)
  109.  
  110. nsDocCharset::nsDocCharset()
  111. {
  112.   /* member initializers and constructor code */
  113. }
  114.  
  115. nsDocCharset::~nsDocCharset()
  116. {
  117.   /* destructor code */
  118. }
  119.  
  120. /* attribute string charset; */
  121. NS_IMETHODIMP nsDocCharset::GetCharset(char * *aCharset)
  122. {
  123.     return NS_ERROR_NOT_IMPLEMENTED;
  124. }
  125. NS_IMETHODIMP nsDocCharset::SetCharset(const char * aCharset)
  126. {
  127.     return NS_ERROR_NOT_IMPLEMENTED;
  128. }
  129.  
  130. /* End of implementation class template. */
  131. #endif
  132.  
  133.  
  134. #endif /* __gen_nsIDocCharset_h__ */
  135.